<template>
	<view class="preview">
		<swiper circular>
			<swiper-item v-for="item in 5" :key="item">
				<image src="/common/images/preview1.jpg"></image>
			</swiper-item>
		</swiper>
		
		<view class="mask" v-if="maskState">
			<view class="goBack"></view>
			<view class="count">1/2</view>
			<view class="time">11:12</view>
			<view class="date">01月12日</view>
			<view class="footer">
				<view class="box" @click="clickInfo">
					<uni-icons type="info" size="28"></uni-icons>
					<view class="text">info</view>
				</view>
				<view class="box">
					<uni-icons type="star" size="28"></uni-icons>
					<view class="text">80s</view>
				</view>
				<view class="box">
					<uni-icons type="download" size="28"></uni-icons>
					<view class="text">down</view>
				</view>
			</view>
		</view>
		
		<uni-popup ref="infoPopup" type="bottom">
			<view class="infoPopup">
				<view class="popHeader">
					<view></view>
					<view class="title">paper info</view>
					<view class="close">
						<uni-icons type="closeempty" size="18" color="#999"></uni-icons>
					</view>
				</view>
			</view>
			<scroll-view scroll-y>
				<view class="content">
					<view class="row">
						<view class="lable">ID:</view>
						<text selectable class="value">123</text>
					</view>
					<view class="row">
						<view class="lable">publisher:</view>
						<text class="value">pub</text>
					</view>
					<view class="row">
						<view class="lable">score:</view>
						<text class="value">
							<uni-rate readonly touchable :value="3.5" size="16"></uni-rate>
							<text class="value">3.5s</text>
						</text>
					</view>
					<view class="row">
						<view class="lable">abstract:</view>
						<text class="value">abstract</text>
					</view>
					<view class="row">
						<view class="lable">label:</view>
						<text class="value">abstract</text>
					</view>
					<view class="copyright">
						声明：本图片来用户投稿，非商业使用，用于免费学习交流，如侵犯了您的权益，
						您可以拷贝壁纸ID举报至平台，邮箱513894357@qq.com，管理将删除侵权壁纸，
						维护您的权益。
					</view>
					<view class="safe-area-inset-bottom"></view>
				</view>
			</scroll-view>
		</uni-popup>
	</view>
</template>

<script setup>
import {ref} from 'vue'

const maskState = ref(true);
const infoPopup = ref(null);

// click info popup
const clickInfo = () => {
	infoPopup.value.open();
}
</script>

<style lang="scss" scoped>
.preview{
	width: 100%;
	height: 100vh;
	position: relative;
	swiper{
		width: 100%;
		height: 100%;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.mask {
		&>view{
			position: absolute;
			left: 0;
			margin: auto;
			color: #fff;
			right: 0;
			width: fit-content;
		}
		.goBack{}
		.count{
			top: 10vh;
			background: rgba(255, 255, 255, 0.3);
			font-size: 28rpx;
			border-radius: 40rpx;
			padding: 8rpx 28rpx;
			backdrop-filter: blur(10rpx);
		}
		.time{
			font-size: 140rpx;
			top: calc(10vh + 80rpx);
			font-weight: 100;
			line-height: 1em;
			text-shadow: 0 4rpx rgba(0, 0, 0, 0.3);
		}
		.date{
			font-size: 34rpx;
			top: calc(10vh + 230rpx);
			text-shadow: 0 2rpx rgba(0, 0, 0, 0.3);
		}
		.footer{
			background: rgba(255, 255, 255, 0.8);
			bottom: 10vh;
			width: 65vw;
			height: 120rpx;
			border-radius: 120rpx;
			color: #000;
			display: flex;
			justify-content: space-around;
			align-items: center;
			box-shadow: 0 2rpx 0 rgba(0, 0, 0, 0.1);
			backdrop-filter: blur(20rpx);
			.box{
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				padding: 2rpx 12rpx;
				.text{
					font-size: 26rpx;
					color: $text-font-color-2;
				}
			}
		}
	}
	
	.popHeader{
		display: flex;
		justify-content: space-between;
		align-items: center;
		
		.title {
			color: $text-font-color-2;
			font-size: 26rpx;
		}
		
		.close {
			padding: 6rpx;
		}
	}
	
	.infoPopup{
		background: #fff;
		padding: 30rpx;
		border-radius: 30rpx 30rpx 0 0;
		overflow: hidden;
		
		scroll-view {
			max-height: 60vh;
		}
	}
}
</style>